/*
 * GuildFraktionInfo - list the reputation and the guild level of all members of a wow guild
 * Copyright (C) [2012 - 2013] [www.marantis.de]
 * 
 * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public 
 * License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later 
 * version.
 * 
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied 
 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License along with this program; if not, 
 * see <http://www.gnu.org/licenses/>.
 */
package de.marantis.app.wow.gfi.control;

import de.marantis.app.wow.gfi.beans.GuildCharacterBean;
import de.marantis.app.wow.gfi.beans.ReputationBean;
import org.apache.log4j.Logger;

public class ReputationConsoleThread extends ReputationThread {

    private final static Logger log = Logger.getLogger(ReputationConsoleThread.class);

    public ReputationConsoleThread(MainController ctrl, GuildCharacterBean guildChar, int completeCount, int actualIdx, HtmlLoadTypeEnum type) {
        super(ctrl, guildChar, completeCount, actualIdx, type);
    }

    @Override
    protected void setStatus(String msg) {
    }

    @Override
    protected void fireReputationBeanUpdated(ReputationBean repBean) {
    }

    @Override
    protected void fireGuildCharUpdated(GuildCharacterBean guildChar, int idx) {
        if (log.isDebugEnabled()) {
            StringBuffer sb = new StringBuffer("");
            sb.append("fireGuildCharUpdated: Name = ");
            sb.append(guildChar.getCharName());
            sb.append(", Reputation = ");

            ReputationBean rep = guildChar.getGuildReputation();
            if (rep == null) {
                sb.append("NULL!");
            } else {
                sb.append(rep.getReputation().toString());
            }

            log.debug(sb.toString());
        }
    }
}
